import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    id: '',
    uname: '',
    islogin: false,
    wallet: '0',
    selectaddress:'',
    // searchKws: '',    
  },
  mutations: {
    setUname(state,username){
      state.uname=username;
    },
    setIslogin(state,islogin){
      state.islogin=islogin;
    },
    setWallet(state,wallet){
      state.wallet=wallet;
    },
    setSa(state,sa){
      state.selectaddress=sa;
    },
    setId:(state,lid)=>{
      state.id=lid;
      // localStorage.setItem('id', lid);
      sessionStorage.setItem('id', lid);
    },
    // search(state,searchKws){
    //   state.searchKws=searchKws;
    // }
  },
  actions: {
  },
  modules: {
  }
})
